home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_ImageMagick.idb / usr / freeware / include / magick / utility.h.z / utility.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  3.1 KB  |  120 lines

  1. #if !defined(vms) && !defined(macintosh) && !defined(WIN32)
  2. #if HAVE_SYS_NDIR_H || HAVE_SYS_DIR_H || HAVE_NDIR_H
  3. # define dirent direct
  4. # define NAMLEN(dirent) (dirent)->d_namlen
  5. # if HAVE_SYS_NDIR_H
  6. #  include <sys/ndir.h>
  7. # endif
  8. # if HAVE_SYS_DIR_H
  9. #  include <sys/dir.h>
  10. # endif
  11. # if HAVE_NDIR_H
  12. #  include <ndir.h>
  13. # endif
  14. #else
  15. # include <dirent.h>
  16. # define NAMLEN(dirent) Extent((dirent)->d_name)
  17. #endif
  18. #include <pwd.h>
  19. #else
  20. #if defined(vms)
  21. #include "vms.h"
  22. #endif
  23. #if defined(macintosh)
  24. #include "mac.h"
  25. #endif
  26. #if defined(WIN32)
  27. #include "nt.h"
  28. #endif
  29. #endif
  30.  
  31. #if !defined(S_ISDIR)
  32. #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
  33. #endif
  34.  
  35. /*
  36.   Utility define declarations.
  37. */
  38. #if !defined(vms)
  39. #define IsGlob(text) \
  40.   ((strchr(text,'*') != (char *) NULL) || \
  41.    (strchr(text,'?') != (char *) NULL) || \
  42.    (strchr(text,'{') != (char *) NULL) || \
  43.    (strchr(text,'}') != (char *) NULL) || \
  44.    (strchr(text,'[') != (char *) NULL) || \
  45.    (strchr(text,']') != (char *) NULL))
  46. #else
  47. #define IsGlob(text) \
  48.   ((strchr(text,'*') != (char *) NULL) || \
  49.    (strchr(text,'?') != (char *) NULL) || \
  50.    (strchr(text,'{') != (char *) NULL) || \
  51.    (strchr(text,'}') != (char *) NULL))
  52. #endif
  53. #if !defined(vms) && !defined(macintosh) && !defined(WIN32)
  54. #define BasenameSeparator  "/"
  55. #define DirectorySeparator  "/"
  56. #define SystemCommand(command)  system(command)
  57. #define TemporaryTemplate  "%s/magickXXXXXX"
  58. #else
  59. #if defined(vms)
  60. #define BasenameSeparator  "]"
  61. #define DirectorySeparator  ""
  62. #define SystemCommand(command)  (!system(command))
  63. #endif
  64. #if defined(macintosh)
  65. #define BasenameSeparator  ":"
  66. #define DirectorySeparator  ":"
  67. #define SystemCommand(command)  MACSystemCommand(command)
  68. #endif
  69. #if defined(WIN32)
  70. #define BasenameSeparator  "/"
  71. #define DirectorySeparator  "/"
  72. #define SystemCommand(command)  NTSystemCommand(command)
  73. #endif
  74. #endif
  75.  
  76. /*
  77.   Utilities routines.
  78. */
  79. extern Export char
  80.   *BaseFilename(const char *),
  81.   **ListColors(const char *,int *),
  82.   **ListFiles(char *,const char *,int *),
  83.   *PostscriptGeometry(const char *),
  84.   *SetClientName(const char *),
  85.   **StringToArgv(char *,int *),
  86.   **StringToList(char *);
  87.  
  88. extern Export int
  89.   GlobExpression(char *,const char *),
  90.   MultilineCensus(const char *),
  91.   ReadDataBlock(char *,FILE *);
  92.  
  93. extern Export unsigned int
  94.   IsAccessible(const char *),
  95.   IsDirectory(const char *),
  96.   ReadData(char *,const unsigned int,const unsigned int,FILE *);
  97.  
  98. extern Export unsigned long
  99.   LSBFirstReadLong(FILE *),
  100.   MSBFirstReadLong(FILE *);
  101.  
  102. extern Export unsigned short
  103.   *ConvertTextToUnicode(char *,unsigned int *),
  104.   LSBFirstReadShort(FILE *),
  105.   MSBFirstReadShort(FILE *);
  106.  
  107. extern Export void
  108.   AppendImageFormat(const char *,char *),
  109.   ExpandFilename(char *),
  110.   ExpandFilenames(int *,char ***),
  111.   LocaleFilename(char *),
  112.   LSBFirstWriteLong(const unsigned long,FILE *),
  113.   LSBFirstWriteShort(const unsigned int,FILE *),
  114.   MSBFirstOrderLong(char *,const unsigned int),
  115.   MSBFirstOrderShort(char *,const unsigned int),
  116.   MSBFirstWriteLong(const unsigned long,FILE *),
  117.   MSBFirstWriteShort(const unsigned int,FILE *),
  118.   Strip(char *),
  119.   TemporaryFilename(char *);
  120.